package com.uyaer.wheel.res
{
	import starling.textures.Texture;
	import starling.textures.TextureAtlas;

	public class ResURI
	{
		[Embed(source="/../assets/texture/home.png")]
		private var HOME_PNG:Class;
		[Embed(source="/../assets/texture/menu.png")]
		private var MENU_PNG:Class;
		[Embed(source="/../assets/texture/map.png")]
		private var MAP_PNG:Class;
		[Embed(source="/../assets/texture/ball.png")]
		private var BALL_PNG:Class;
		[Embed(source="/../assets/texture/map_fill.png")]
		private var MAP_FILL:Class;
		[Embed(source="/../assets/texture/home_hill.png")]
		private var HOME_HILL:Class;
		[Embed(source="/../assets/texture/home.xml",mimeType="application/octet-stream")]
		private var HOME_XML:Class;
		[Embed(source="/../assets/texture/menu.xml",mimeType="application/octet-stream")]
		private var MENU_XML:Class;
		[Embed(source="/../assets/texture/map.xml",mimeType="application/octet-stream")]
		private var MAP_XML:Class;
		[Embed(source="/../assets/texture/ball.xml",mimeType="application/octet-stream")]
		private var BALL_XML:Class;
		[Embed(source="/../assets/audio/gaming.mp3",mimeType="audio/mpeg")]
		private var AUDIO_GAMING:Class;
		[Embed(source="/../assets/audio/hit.mp3",mimeType="audio/mpeg")]
		private var AUDIO_HIT:Class;
		[Embed(source="/../assets/audio/home.mp3",mimeType="audio/mpeg")]
		private var AUDIO_HOME:Class;
		
		public function init():void{
			initMenu();
			initGame();
			initAudio();
		}
		
		private function initAudio():void{
			ResManager.me.addSound("audio_gaming",new AUDIO_GAMING());
			ResManager.me.addSound("audio_hit",new AUDIO_HIT());
			ResManager.me.addSound("audio_home",new AUDIO_HOME());
		}
		
		private function initGame():void{
			var atlas:TextureAtlas = new TextureAtlas(Texture.fromBitmap(new MAP_PNG()),XML(new MAP_XML()));
			ResManager.me.addTextureAtlas("map",atlas);
			atlas = new TextureAtlas(Texture.fromBitmap(new BALL_PNG()),XML(new BALL_XML()));
			ResManager.me.addTextureAtlas("ball",atlas);
			ResManager.me.addTexture("map_fill",Texture.fromBitmap(new MAP_FILL()));
		}
		
		private function initMenu():void{
			var atlas:TextureAtlas = new TextureAtlas(Texture.fromBitmap(new HOME_PNG()),XML(new HOME_XML()));
			ResManager.me.addTextureAtlas("home",atlas);
			atlas = new TextureAtlas(Texture.fromBitmap(new MENU_PNG()),XML(new MENU_XML()));
			ResManager.me.addTextureAtlas("menu",atlas);
			ResManager.me.addTexture("home_hill",Texture.fromBitmap(new HOME_HILL()));
		}
	}
}